home *** CD-ROM | disk | FTP | other *** search
- unit testdrop;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ComCtrls, filedrag;
-
- type
- TForm1 = class(TForm)
- ListView1: TListView;
- FileDrag1: TFileDrag;
- procedure FileDrag1Drop(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FileDrag1Drop(Sender: TObject);
- var
- x: Integer;
- item: TListItem;
- begin
- x := 0;
- while x < FileDrag1.FileCount do
- begin
- item := ListView1.Items.Add;
- item.caption := FileDrag1.NameWithPath[x];
- item.SubItems.Add( FileDrag1.NameOnly[x] );
- item.SubItems.Add( FileDrag1.Extension[x] );
- Inc( x );
- end;
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- FileDrag1.EnableDrop := True;
- end;
-
- end.
-